<?
define("COMPONENT", basename(__DIR__));
define("JS", TRUE);
$javascript = array("respond", "orientationfix", "modernizr");

// header
require_once("../global/header.php");

function strip_only($str, $tags, $stripContent = false) {
    $content = '';
    if (!is_array($tags)) {
        $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
        if (end($tags) == '')
            array_pop($tags);
    }
    foreach ($tags as $tag) {
        if ($stripContent)
            $content = '(.+</' . $tag . '[^>]*>|)';
        $str = preg_replace('#</?' . $tag . '[^>]*>' . $content . '#is', '', $str);
    }
    return $str;
}

function getHtmlComponente($file) {
    $html = file_get_contents($file);

    $html = strip_only($html, array("script", "link"));

    if (preg_match('~<body[^>]*>(.*?)</body>~si', $html, $body)) {
        echo $body[1];
    } else {
        echo "na";
    }
}

function getHtmlComponenteVideo($file) {
    $html = file_get_contents($file);

    #$html = strip_only($html, array("script", "link"));

    if (preg_match('~<body[^>]*>(.*?)</body>~si', $html, $body)) {
        echo $body[1];
    } else {
        echo "na";
    }
}
?>


<!-- BEGIN: <Template news> --> 
<section class="nt_search_main_01"> 
	
    <div class="bannerNewsHeader">
        <img src="http://placehold.it/300x52" alt="Banner">
    </div>
    
    <header class="main-header"><?php getHtmlComponente("../nav_header_02/index.html"); ?></header>

    <!-- BEGIN: <main> -->
    <div class="main">

<!-- BEGIN: <contenedor1> -->
        <div class="container-search">
        	<!--Buscador-->
        	<?php getHtmlComponenteVideo("../wdg_search_01/index.html"); ?>
        </div>
        <div class="container-one">
            <div class="container-one-left1"> 
                <?php getHtmlComponenteVideo("../wdg_biography_01/index.html"); ?> 
            </div>  
        </div> 
        <!-- END: <contenedor1> -->


        <div class="container-one">
            <div class="container-one-left"> 
                <?php getHtmlComponente("../mix_3artspag_01/index.html"); ?> 
                <?php getHtmlComponente("../mix_4artspag_01/index.html"); ?>
                <?php getHtmlComponente("../mix_3artspag_02/index.html"); ?>
            </div> 

            <div class="container-one-right2"> 
                <div id="bannerNews3">
                    <img src="http://placehold.it/300x250" alt="Banner">
                </div>
            </div> 
        </div> 

       

    </div> 
    <!-- END: <main> -->

    <footer class="footerVertical">
        <?php getHtmlComponente("../nav_corft_01/index.html"); ?> 
    </footer>
    <!-- END: <footer> -->
</section> 
<!-- END: <Template news> -->



<?
// footer
require_once("../global/footer.php");
?>